<template lang="html">
  <section class="wrapper">
    <ul class="stars">
      <li class="star"></li>
      <li class="star"></li>
      <li class="star"></li>
      <li class="star"></li>
      <li class="star"></li>
    </ul>
  </section>
</template>

<script>
export default {
}
</script>

<style lang="scss" scoped>
$starSize: 100px;
.wrapper {
  // background: radial-gradient(center, rgba(60, 50, 60, 1) 0%,rgba(0, 0, 0, 1) 100%);
  background: radial-gradient(circle at center, rgba(60, 50, 60, 1) 0%, rgba(0, 0, 0, 1) 100%);
  // background: rgba(0, 0, 0, 1);
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 350px;
}
.stars {
  display: flex;
  transform-style: preserve-3d;
  animation: rotate 15000ms linear infinite;
}
.star {
  width: $starSize;
  height: $starSize;
  background: linear-gradient(-30deg, rgba(100, 100, 100, 0) 0%, rgba(125, 125, 125, 0.2) 50%, rgba(150, 150, 150, 0.3) 51%, rgba(100, 100, 100, 0) 100%);
  background-size: $starSize * 3 100%;
  background-position: 0 0;
  // 画星星
  clip-path: polygon($starSize / 2 0px, $starSize / 5 $starSize, $starSize $starSize / 2.5, 0px $starSize / 2.5, $starSize / 1.2 $starSize);
  animation: rotate 5000ms linear infinite;
}

@keyframes rotate {
  0% {
    transform: rotateY(0deg) rotateZ(0deg);
    background-position: 0 0;
  }
  100% {
    transform: rotateY(360deg) rotateZ(0deg);
    background-position: -$starSize * 6 0;
  }
}
</style>
